package cn.com.cpic.insurance.rulecheck.core.test;

import junit.framework.TestCase;
import cn.com.cpic.insurance.rulecheck.core.BomContext;
import cn.com.cpic.insurance.rulecheck.core.Context;

/**
 * 
 * 
 * @author 代波
 * @since 2011-8-15
 */
public abstract class BaseRuleCheckTestCase extends TestCase {
	protected BomContext bomCtx;
	protected Context ctx;

	@Override
	protected void setUp() throws Exception {
		bomCtx = ConditionTestUtils.createBOMContext();
		ctx = ConditionTestUtils.createContext(bomCtx);
		super.setUp();
	}

	protected final Object addBOM(Object key, Object value) {
		return bomCtx.addBom(key, value);
	}

	protected final Object bom(Object value) {
		return new ParaBom(value);
	}

	public static class ParaBom {
		private Object value;

		public ParaBom(Object value) {
			this.value = value;
		}

		public Object getValue() {
			return value;
		}

		public void setValue(Object value) {
			this.value = value;
		}
	}
}
